<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script src="../lib/layui/layui.js" charset="utf-8"></script>
</head>
<body>
      <!-- test from-->
    <form id="testForm" method="get" action="">
        用户名<input name="test1">
        密码<input name="test2">
        手机<input name="test3">
        邮箱<input name="test4">
        <input type="submit" value="提交">
    </form>

<form class="layui-form">
                <div class="layui-form-item">

                    <div class="layui-inline">
                        <label class="layui-form-label">公司名：</label>
                        <div class="layui-input-inline">
                            <input  name="keyword" id="keyword" class="layui-input">
                        </div>
                    </div>

                    <div class="layui-form-item layui-inline">
                        <button class="layui-btn" lay-submit lay-filter="formDemo">搜索</button>
                    </div>

                </div>
            </form>

</body>

<script>


    layui.use('form', function () {
        var form = layui.form;

        form.on('submit(formDemo)', function (data) {
         console.log(data.field);
         return false;
    })    

});

</script>

</html>